/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package generovanieRozpisu;

import java.util.Comparator;

/**
 *
 * @author Ondrej
 */
public class Dvojica  implements Comparable<Dvojica> {
    private int zam1, zam2, typ, vztah; // typ 0 denna, typ 1 nocna
    private Double rating, sucetVahovani;
    static final Comparator<Dvojica> PODLA_VZTAHU = new Comparator<Dvojica>() {
        @Override
        public int compare(Dvojica d1, Dvojica d2) {
            return new Double(d1.vztah).compareTo(new Double(d2.vztah));
        }
    };    

    public Dvojica(int zam1, int zam2, double rating, int vztah, int typ, double sucetVahovani) {
        this.zam1 = zam1;
        this.zam2 = zam2;
        this.typ = typ;
        this.rating = rating;
        this.vztah = vztah;
        this.sucetVahovani = sucetVahovani;
    }

    /**
     * @return the zam1
     */
    public int getZam1() {
        return zam1;
    }

    /**
     * @return the zam2
     */
    public int getZam2() {
        return zam2;
    }

    /**
     * @return the vztah
     */
    public double getRating() {
        return rating;
    }

    /**
     * @return the typ
     */
    public int getTyp() {
        return typ;
    }

    @Override
    public int compareTo(Dvojica o) {
        return this.rating.compareTo(o.getRating());
    }

    /**
     * @return the vztah
     */
    public int getVztah() {
        return vztah;
    }

    /**
     * @param rating the rating to set
     */
    public void setRating(Double rating) {
        this.rating = rating + ondrejovGenerator.c * sucetVahovani;
    }
     
}
